package Aaaaaa;

import java.util.Deque;
import java.util.LinkedList;
import java.util.Scanner;

public class Main13 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long n=sc.nextLong();
        int l=sc.nextInt();
        int r=sc.nextInt();

        StringBuilder res=new StringBuilder();
        Deque<Long> q=new LinkedList<>();
        q.offer(n);
        while(!q.isEmpty()){
            long temp=q.poll();
            if(temp==0||temp==1){
                res.append(temp);
            }else{
                long a=temp/2;
                long b=temp%2;
                q.addFirst(a);
                q.addFirst(b);
                q.addFirst(a);
            }
        }
        int count=0;
        System.out.println(res);
            for (int i = l-1; i < r; i++) {
                if (res.charAt(i) == '1') {
                    count++;
                }
            }
            System.out.println(count);

    }
}
